﻿@model WebDomain.Entities.Product

@{
    ViewBag.Title = @Model.Name;
}
<div id="product">
<h2 style="border-bottom: 1px solid #000">@Model.Name</h2>
<table width = "100%">
<tr>
<td rowspan="2" width="40%">
@if (Url.Action("GetImage", "Product", new { Model.ID })!=null){
<a href="@Url.Action("GetImage","Product", new { Model.ID })">
<img width = "275px" src="@Url.Action("GetImage","Product", new { Model.ID })"  alt="@Model.Name"/></a>}</td>
<td>Category: @Model.Type</td><td>Price: @Model.Price.ToString("c")</td><td>
@if(Model.IsNew)
    {
    @:<br />New!
    }</td></tr><tr><td colspan="3">@Model.Description</td></tr></table>
</div>
@using (Html.BeginForm("AddToCart", "Cart"))
{
@Html.HiddenFor(x => x.ID)
@Html.Hidden("returnUrl", Request.Url.PathAndQuery)
<input type="submit" value="Add to cart" />
}